package com.changgou.order.feign;

import com.changgou.entity.Result;
import com.changgou.order.pojo.Order;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * @author wz
 * @company 公司
 * @create 2020-04-03 9:37
 */
@FeignClient(name = "order")
public interface CartFeign {
    /**
     * 添加购物车
     */
    @GetMapping("/cart/add")
    public Result add(@RequestParam("skuId") String skuId, @RequestParam("num") Integer num);

    /**
     * 查询购物车
     */
    @GetMapping("/cart/list")
    public Map list();

    /***
     * 提交订单数据
     * @param order
     * @return
     */
    @PostMapping("/cart")
    public Result add(@RequestBody Order order);
}
